package com.xpc.mapper;

import com.xpc.pojo.qin.LoginUserInfo;
import com.xpc.pojo.qin.StudentsSimpleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Qinkuer
 * @version 1.0.0
 * @ProjectName UniversityGradeAdministrationSystem
 * @ClassName LoginUserInfoMapper.java
 * @Description 为获取登录账号部分个人信息
 * @createTime 2022年06月17日 12:00:00
 */
@Mapper
public interface LoginUserInfoMapper {

//    select a.*,c.name as className	from
//            (select a.*,s.class_id as classId from
//                    (select a.userId,u.nickname,u.head_portrait as headPortrait,u.name,u.gender,u.position_state as positionState  from
//                     (select a.user_id as userId from account a where account_id = "1900300417") as a
//    left join `user` u on a.userId=u.user_id ) as a
//    left join student s on a.userId=s.user_id ) as a
//    left join class c on a.classId=c.id
    @Select("select a.*,c.name as className\tfrom\n" +
            "\t(select a.*,s.class_id as classId from\n" +
            "\t\t(select a.userId,u.nickname,u.head_portrait as headPortrait,u.name,u.gender,u.position_state as positionState  from\n" +
            "\t\t\t(select a.user_id as userId from account a where account_id = #{accountId}) as a \n" +
            "\t\tleft join `user` u on a.userId=u.user_id ) as a\n" +
            "\tleft join student s on a.userId=s.user_id ) as a\n" +
            "left join class c on a.classId=c.id ")
    LoginUserInfo getLoginUserInfoByAccountId(@Param("accountId")String accountId);
}
